Skip to content

[codex] add Horizon 5.0R resistance table - #4759

Merged
cagnulein merged 4 commits into
masterfrom
codex/horizon-5r-resistance-table
Aug 4, 2026
Merged

[codex] add Horizon 5.0R resistance table#4759
cagnulein merged 4 commits into
masterfrom
codex/horizon-5r-resistance-table

Conversation

@cagnulein

@cagnulein cagnulein commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Load a default ERG calibration table generated from ResistanceTable20260626.xlsx for the Horizon 5.0R Bluetooth name JFBK5.0R.
  • Reuse the existing FTMS detection path for JFBK5.0* devices instead of adding a second Bluetooth pattern.
  • Add device detection coverage for the exact JFBK5.0R name.

Notes

JFBK5.0R was already covered by the existing JFBK5.0 FTMS bike pattern in bluetooth.cpp. The model-specific change is therefore in ftmsbike.cpp, where only the full JFBK5.0R name loads the Horizon 5.0R calibration table.

Validation

  • Verified existing JFBK5.0 pattern coverage with rg.
  • git diff --check
  • Parsed the generated table: 3,157 points, cadence 50-110, wattage 37-480, resistance 0-100.
  • g++ -fsyntax-only check for the new horizon5r_defaults.h header.

Full local build/tests were not completed because this worktree is missing existing dependencies/submodules: tst/googletest for tests and smtpclient/src/SmtpMime for the app build.

@cagnulein
cagnulein force-pushed the codex/horizon-5r-resistance-table branch from a0b243c to 949e092 Compare June 26, 2026 18:57
@cagnulein
cagnulein force-pushed the codex/horizon-5r-resistance-table branch from 949e092 to 8666183 Compare June 27, 2026 03:25
Quantize cadence to 5 RPM bands in resistanceFromPowerRequest before
the table lookup. Without this, a 2 RPM cadence change shifts the
interpolated wattage estimate enough to cross a resistance boundary,
triggering unnecessary resistance changes on bikes with high-density
ERG tables (e.g. user-learned data at 1 RPM granularity).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cagnulein
cagnulein marked this pull request as ready for review July 1, 2026 15:08
cagnulein and others added 2 commits July 7, 2026 07:21
Cadence noise right at a lookup-table quantization boundary can flip
the computed resistance back and forth every update() cycle even after
5 RPM quantization (04a4501). Require the new resistance to be
requested consistently for 2s before committing it, instead of acting
on every single fluctuation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@stale

stale Bot commented Jul 25, 2026

Copy link
Copy Markdown

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale Bot added the wontfix This will not be worked on label Jul 25, 2026
@stale stale Bot closed this Aug 2, 2026
@cagnulein cagnulein reopened this Aug 3, 2026
@cagnulein
cagnulein merged commit 6543e92 into master Aug 4, 2026
55 of 56 checks passed
@cagnulein
cagnulein deleted the codex/horizon-5r-resistance-table branch August 4, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant